﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SmartForm.Common
{
    public class DataBase
    {
        public static string dbPath = Application.StartupPath + "\\smartForm.db";
        private static IDbConnection db= new SQLiteConnection(string.Format("Data Source={0};Pooling=true;FailIfMissing=false", dbPath));

        public static IDbConnection DB
        {
            get
            {
                if (db.State == ConnectionState.Closed)
                {
                    db.Open();
                }
                return db;
            }
        }
    }
}
